import React, { FC } from 'react';
import LoginSuccess from '../../../components/login-success';
import zhucechenggong from '../../../assets/img/zhucechenggong.png';
import { useHistory } from 'react-router-dom';

// 注册成功页
const LogSuccess: FC = (props: any) => {

    const history = useHistory();

    if (props.location?.state?.type === "user") {
        return <LoginSuccess
                    jump={() => history.push("/userLogReg")}
                    imgSrc={zhucechenggong}
                    btnText="进入用户首页"
                />
    } else {
        return <LoginSuccess
                    jump={() => history.push("/merLogReg")}
                    imgSrc={zhucechenggong}
                    btnText="进入商家首页"
                />
    }

}
export default LogSuccess;